<template>
  <div class="index">
    <el-container v-if="!isShow">
      <!-- 部署时需要隐藏 -->
      <el-aside width="270px">
        <leftBar />
      </el-aside>
      <el-container>
        <!-- 部署时需要隐藏 -->
        <el-header height="152px">
          <navTop />
        </el-header>
        <el-main>
          <keep-alive>
            <router-view v-if="$route.meta.keepAlive"></router-view>
          </keep-alive>
          <router-view v-if="!$route.meta.keepAlive"></router-view>
        </el-main>
      </el-container>
    </el-container>
    <div v-if="isShow">
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
      </keep-alive>
      <router-view v-if="!$route.meta.keepAlive"></router-view>
    </div>
  </div>
</template>

<script>
import navTop from "../components/navTop.vue";
import leftBar from "../components/leftBar.vue";

export default {
  name: "index",
  components: { navTop, leftBar },
  data() {
    return {
      ids: "", //是否是外部接入 1是
      isShow: false,
    };
  },
  mounted() {
    this.ids = this.$route.query.ids;
    if (this.ids) {
      window.sessionStorage["ids"] = this.ids;
    }
    if (window.sessionStorage["ids"] == 1) {
      this.isShow = true;
    } else {
      this.isShow = false;
    }
  },
  methods: {},
};
</script>
<style scoped lang="scss">
.index {
  width: 100%;
  height: 100%;
  .el-main,
  .el-header {
    background: #fff;
    padding: 0;
  }
}
</style>

